import axios from 'axios'
import { defineStore } from 'pinia'
import { computed, ref } from 'vue'
export const useJokerStore = defineStore('joke', () => {
  const joke = ref('哈哈哈哈哈哈哈')
  const setJoke = () => {
    setTimeout(async () => {
      const res = await axios.get('https://api-vue-base.itheima.net/api/joke')
      joke.value = res.data
    }, 1000)
  }
  return { joke, setJoke }
})
